import request from "@/utils/request";

/**
 *
 * 获取banner列表
 *
 */
export function getBannerList(data, page = 1, pageSize = 10) {
  return request({
    url: `/banner/list?pageNo=${page}&pageSize=${pageSize}`,
    method: "post",
    data,
  });
}

// 获取优惠券详情
export function getBannerDetail(id) {
  return request({
    url: `/banner/getDetailById?theId=${id}`,
  });
}

// 新增或者编辑优惠券
export function addOrEditBanner(data) {
  return request({
    url: "/banner/saveUpdate",
    method: "post",
    data,
  });
}

// 删除优惠券
export function deleteBanner(id) {
  return request({
    url: `/banner/deleteByStatus?theId=${id}`,
  });
}
